home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-23 | 1.6 KB | 77 lines | [TEXT/MSET] |
- \ GWorld Class
- \ e d - b o y
- \ 951013
-
- \ This only works in 8-bit colour at the moment
- \ Remember to allocate plenty of memory to Mops if you're using this
-
- \ some useful words
-
- ptr origPort
- handle origDevice
-
- : EnterGWorld
- origPort origDevice call GetGWorld ;
-
- : ExitGWorld
- get: origPort get: origDevice call SetGWorld ;
-
-
- :class GWORLD super{ object }
- ptr GWorldPtr
- handle PixMap
- handle CTable
- handle gDHandle
- rect Bounds
- 4 bytes flags
-
- :m SETBOUNDS: \ ( l t r b -- )
- put: bounds ;m
-
- :m NEW:
- GWorldPtr 0 makeint bounds PixMap CTable flags call NewGWorld ;m
-
- :m PEEK: \ useful for debugging (returns zero or nilp if GWorld not created
- get: GWorldPtr . cr ;m
-
- :m PEEKPM: \ ditto
- get: PixMap . cr ;m
-
- :m GETPMHANDLE: \ creates PixMap and stores its handle
- 0 get: GWorldPtr call GetGWorldPixMap put: PixMap ;m
-
- :m GETGDHANDLE: \ sets graphic device handle
- 0 get: GWorldPtr call GetGWorldDevice put: gDHandle ;m
-
- :m SET: \ makes GWorld current port
- get: GWorldPtr get: gDHandle call SetGWorld ;m
-
-
- :m LOCKPIXELS: \ ( -- bool ) TRUE if GWorld ready for drawing
- get: PixMap call LockPixels ;m
-
- :m UNLOCKPIXELS:
- get: PixMap call UnlockPixels ;m
-
- :m GETPIXBASEADDR: \ ( -- ptr ) included for block moves between GWorlds
- 0 get: PixMap call GetPixBaseAddr ;m
-
- :m DISPOSE:
- get: GWorldPtr call DisposeGWorld ;m
-
- :m RELEASE: \ mh - normal Mops destructor method
- dispose: self ;m
-
- :m CREATE: \ ( l r t b -- ) quick way to make a GWorld
- setBounds: self
- new: self
- getPMHandle: self
- getGDHandle: self
- ;m
-
- :m GETPORTPIXMAP: \ compatible with GrafPort call (bit of a kludge)
- get: GWorldPtr 2 + ;m
-
- ;class
-
-